package nccloud.web.arap.amortization.action;

import java.util.Map;

import org.apache.commons.collections4.map.HashedMap;

import nc.itf.org.IAccountingBookQryService;
import nc.itf.pubapp.pub.smart.IBillQueryService;
import nc.vo.org.AccountingBookVO;
import nc.vo.pub.BusinessException;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;

public class QueryAccAction implements ICommonAction {

	@Override
	public Object doAction(IRequest request) { 
		String pk = request.read();
		AccountingBookVO vo = null;
		try {
			vo = ServiceLocator.find(IAccountingBookQryService.class).queryMainAccountingBookVOByOrgIDAndBookType(pk, "accounttype");
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		
		Map<String, String> map = new HashedMap<String, String>();
		if (vo ==null ) {
			map.put("accbook", "");
		}else {
			map.put("accbook", vo.getPk_accountingbook());
		}
		return map;
	}

}
